const webpack = require('webpack')
module.exports = {
    devtool:'eval-source-map',
    entry: __dirname + "/app/main.js",
    output: {
        path: __dirname+"/public",
        filename: "bundle.js"
    },
    devServer:{
        contentBase:'./public',
        historyApiFallback:true,//不跳转
        inline:true//实时刷新
    },
    module: {
        rules: [
            {
                test:/(\.jsx|\.js)$/,
                use:{
                    loader: "babel-loader",
                },
                exclude:/node_modules/
            },
            {
                test:/\.css$/,
                use:[
                    {loader: "style-loader"},
                    {
                        loader: "css-loader",
                        options: {
                            modules:true
                        }
                    },
                    {
                        loader: "postcss-loader"
                    }
                ]
            }
        ]
    },
    plugins: [
        new webpack.BannerPlugin('金禾不会亏待你！')
    ]
}